<template>
  <div>
    <el-dialog
      destroy-on-close
      :title="title"
      :visible.sync="visiblesbgbm1"
      :close-on-click-modal="false"
      width="800px"
      @close="onClose"
    >
      <el-table v-loading="loadingAboutE" :data="tableData" style="width: 100%" height="350">
        <el-table-column prop="keytask" label="重点任务" min-width="180">
          <template slot-scope="scope">
            <el-link type="success" @click="onClickTwo(scope.row)">{{ scope.row.keytask }}</el-link>
          </template>
        </el-table-column>
        <el-table-column prop="expdate" label="截至日期" width="180"> </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>

<script>
import { QueryPageList } from '@/api/task/index'

export default {
  // props: ['Reminder'],

  data() {
    return {
      queryFormAboutE: {
        expday1: 0,
        expday2: 7,
        orgid: this.$store.getters.userInfo.orgid,
        userid: this.$store.getters.userInfo.id
      },
      loadingAboutE: false,
      tableData: [],
      // visiblesbgbm1: this.Reminder,
      visiblesbgbm1: false,

      title: '温馨提示-即将到期任务'
    }
  },

  // watch: {
  //   Reminder(val) {
  //     this.visiblesbgbm1 = val
  //   }
  // },
  created() {
    this.AboutExpire()
  },
  methods: {
    // 即将到期任务
    async AboutExpire() {
      this.loadingAboutE = true
      const { content } = await QueryPageList(this.queryFormAboutE)
      this.tableData = content.list
      if (this.tableData.length > 0) {
        this.visiblesbgbm1 = true
      }
      this.loadingAboutE = false
    },
    onClickTwo(row) {
      console.log(row)
      this.visiblesbgbm1 = false
      this.$router.push('/Fourth/Tasklist/TasklistAddC?id=' + row.id + '&title=' + row.proname + '&proid=' + row.proid)
    },
    // 点击关闭给父组件传值
    onClose() {
      this.$emit('fatherbgbu')
    }
  }
}
</script>

<style></style>
